<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //数组展开运算符的基本用法
        //  console.log(Math.min(...[2, 33, 44])); //2
        //  //相当于
        //  console.log(Math.min(3, 33, 22)); //3


        //区分剩余参数和展开运算符
        //剩余参数   2,3,4->:[2,3,4]
        //展开运算符:  [2,3,4]->2,3,4

        //   const add = (...args) => {
        //       // console.log(args);
        //       console.log(...args);
        //   }
        //   add(1, 2, 3, 4) //1 2 3 4

        console.log([
            ...[1, 2, 3], 4, 5
        ]); //[1, 2, 3, 4, 5]
    </script>
</body>

</html>